package com.avril.service;

import java.util.Vector;

import com.avril.db.UserDao;
import com.avril.entity.User;


public class UserService{

	private UserDao userDao = null;
	public boolean loginCheck(String username, String password) {
		userDao = new UserDao();
		return userDao.loginCheck(username, password);
	}

	public boolean addUser(User user) {
		userDao = new UserDao();
		return userDao.addUser(user);
	}

	public boolean deleteUser(String userName) {
		userDao = new UserDao();
		return userDao.deleteUser(userName);
	}

	public String getPassword(String userName) {
		userDao = new UserDao();
		return userDao.getPassword(userName);
	}

	public String getPower(String username) {
		userDao = new UserDao();
		return userDao.getPower(username);
	}

	public Vector<User> getUser(String type) {
		// TODO Auto-generated method stub
		return null;
	}



	public boolean modifyPassword(String userName, String password) {
		userDao = new UserDao();
		return userDao.modifyPassword(userName, password);
	}

	public boolean isExist(String userName) {
		userDao = new UserDao();
		return userDao.isExist(userName);
	}

	public User getUserByName(String userName) {
		userDao = new UserDao();
		return userDao.getUserByName(userName);
	}

	public Vector<String> getAllOperators() {
		userDao = new UserDao();
		return userDao.getAllOperators();
	}

}
